/**
 * .
 *
 * @author Xu Yayuan
 * @date 2021/10/29
 */

import org.springframework.core.env.SystemEnvironmentPropertySource;

import javax.swing.filechooser.FileSystemView;
import java.io.File;
import java.util.HashSet;
import java.util.Set;

/**
 * 。
 *
 * @author Xu Yayuan
 * @date 2021/10/29 16:24
 */
public class DemoTest {
    public static void main(String[] args) {
        File desktopDir = FileSystemView.getFileSystemView().getHomeDirectory();

        String desktopPath = desktopDir.getAbsolutePath();

        System.out.println("desktopPath" + desktopPath);

        byte i = 127;
        byte j = (byte) 128;
        byte k = (byte) 129;
        byte m = (byte) 136;
        System.out.println("i=" + i);
        System.out.println("j=" + j);
        System.out.println("k=" + k);
        System.out.println("m=" + m);

        Set<String> s = new HashSet<>();
        s.add("a");
        s.add("b");
        s.add("a");
        s.add("b");
        for (String s1 : s) {
            System.out.println(s1);
        }

        System.out.println(getValueType(0));
        System.out.println(getValueType(512));
        System.out.println(getValueType(-32768));

    }
    public static String getValueType(int ds) {
        int binaryStringLength = Integer.toBinaryString(ds).length();
        switch (binaryStringLength) {
            case 1:
                return "0";
            case 10:
                return "1";
            default:
                return "2";
        }

    }
}
